package com.company.jt.demo.service;

import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MemoryService {
    public List<Map<String,Object>> list(){

        System.out.println("从数据库拿到数据");
        //假设如下数据来自数据库
        Map<String,Object> mm = new HashMap<>();
        mm.put("id", 100);
        mm.put("title", "标题-A");

        Map<String,Object> mk = new HashMap<>();
        mk.put("id", 101);
        mk.put("title", "标题-B");
        List<Map<String,Object>> list = new ArrayList<>();
        list.add(mm);
        list.add(mk);
        return list;

    }
}
